-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[components] Add windows testing to dagster-dg (BUILD-672) #27537
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c5f92c5
to
9894ca5
Compare
0ad8ae0
to
81af794
Compare
7dbac06
to
9995d6c
Compare
81af794
to
594bc15
Compare
|
||
venv_bin = Path.cwd() / ".venv" / "bin" | ||
with modify_environment_variable( | ||
"PATH", os.pathsep.join([str(venv_bin), os.pathsep, os.environ["PATH"]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PATH
construction has an extra separator due to os.pathsep
being included in the join list. This creates paths like /venv/bin::/usr/bin
with double separators. The correct construction should be:
os.pathsep.join([str(venv_bin), os.environ['PATH']])
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
9995d6c
to
f13115a
Compare
f4597f5
to
a17e230
Compare
def test_join_path(): | ||
from pathlib import Path | ||
|
||
my_path = Path("foo/bar") | ||
updated_path = my_path / "baz" | ||
print(updated_path) | ||
assert False | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test appears to be a debugging function that was inadvertently committed. It contains a forced failure (assert False
) and debug print statements, suggesting it was used to investigate Path
joining behavior. Consider removing this test or converting it into meaningful test coverage if path joining behavior needs verification.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
e2d78a6
to
d3c450d
Compare
25c7c84
to
fb67fa3
Compare
fb67fa3
to
bd8f823
Compare
d3c450d
to
f5a7070
Compare
bd8f823
to
ed918eb
Compare
f5a7070
to
1825d72
Compare
3aaa2a9
to
ed2eb96
Compare
c866c43
to
6633929
Compare
d1fc49e
to
fcb0c8f
Compare
@@ -78,6 +77,7 @@ def clear_key(self, key: tuple[str, ...]) -> None: | |||
|
|||
def clear_all(self) -> None: | |||
shutil.rmtree(self._root_path) | |||
assert not self._root_path.exists() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just confirming this was intentional and not a local testing thing, could imagine warning or something being less disruptive if this didn't happen for some obscure filesystem reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that actually was a testing thing, good catch
@@ -31,6 +32,27 @@ | |||
CLI_CONFIG_KEY = "config" | |||
|
|||
|
|||
def is_windows() -> bool: | |||
return platform.system() == "Windows" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way we check this in dagster core is slightly different, not sure if that matters
IS_WINDOWS = os.name == "nt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chatGPT claims sys.platform == "win32"
is most robust so going with that.
def is_macos() -> bool: | ||
return platform.system() == "Darwin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
high confidence this covers all mac flavors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably does, but changed to sys.platform == "darwin"
since that is likely most robust.
@@ -85,10 +107,16 @@ def is_executable_available(command: str) -> bool: | |||
return bool(shutil.which(command)) or bool(get_uv_run_executable_path(command)) | |||
|
|||
|
|||
# Short for "normalize path"-- use this to get the platform-correct string representation of an | |||
# existing string path. | |||
def npath(path: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would find normalize_path clearer as a reader fwiw at the expense of your wrist tendons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea-- changed to cross_platform_string_path
for absolute clarity. Mouthful but there's only one callsite anyway.
b55cf67
to
29dcb43
Compare
29dcb43
to
00d5369
Compare
Summary & Motivation
dagster-dg
is currently broken on Windows. I found this out by trying to add Windows testing. This PR fixesdg
for Windows and adds Windows testing.dagster-dg
.Path
and don't contain embedded "/"dg dev
NOTE: There are still some problems with
dg dev
testing in the CLI environment on Windows, so thedg dev
tests are skipped in this PR. They will be re-added upstack.How I Tested These Changes
Test suite now passes on Windows.